package com.zxw.克隆;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @projectName: util-cloud
 * @package: com.zxw.test
 * @className: A
 * @author: zhangxuewei
 * @description: TODO
 * @date: 2024/3/1 17:02
 * @version: 1.0
 */
public class A {
    public static void main(String[] args) {
        String input = "定期支取转入-子账户序号:191,利息:345.08元";
        String pattern = "利息：?:?\\s*(\\d+(\\.\\d+)?)";

        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(input);

        if (m.find()) {
            String interestValue = m.group(1);
            System.out.println("提取到的利息值为：" + interestValue);
        } else {
            System.out.println("未找到匹配的利息值");
        }
    }
}
